Good day. eval_"#include<standard/BaselineSetDefinition/NewBaselineSet.dxl>"
I also tried what the dxl manual suggests: create(Folder f, string name, string desc, BaselineSetDefinition &bsd)
Folder f = folder("/OIOIOI_Systems")
create(Folder f, "BaselineSetCompleteness", "", BaselineSetDefinition &bsd)
Bruwbruw - Wed Oct 24 12:26:56 EDT 2012 |
Re: Emulate BaselineSet
ooops! =)
void createBSD()
Folder f = folder("/OIOIOI_Systems")
{
BaselineSetDefinition newBSD = null
string bsdName = "BaselineSetCompleteness modules"
string bsdDesc = "Modules from completeness"
string errmess
errmess = create(f, bsdName, bsdDesc, newBSD)
if (!null errmess)
{
errorBox "Unable to create a new Baseline Set" errmess
return
}
errmess = lock(newBSD)
{
errorBox "Cannot lock new Baseline Set Definition" errmess
return
}
//ADD MODULES
Item i
ModName_mod
for i in f do{
if (type(i) == "Formal")
{
mod = module(fullName i)
{
if (!null mod)
{
errmess = addModule(mod, newBSD)
if (!null errmess)
{
errorBox "Could not add module" name(mod)" : " errmess
}
}
}
}
}
errmess = save(newBSD)
if (!null errmess)
{
errorBox "Failed to save Definition" errmess
}
unlock(newBSD)
}
createBSD
|
Re: Emulate BaselineSet Bruwbruw - Wed Oct 24 12:47:53 EDT 2012
ooops! =)
void createBSD()
Folder f = folder("/OIOIOI_Systems")
{
BaselineSetDefinition newBSD = null
string bsdName = "BaselineSetCompleteness modules"
string bsdDesc = "Modules from completeness"
string errmess
errmess = create(f, bsdName, bsdDesc, newBSD)
if (!null errmess)
{
errorBox "Unable to create a new Baseline Set" errmess
return
}
errmess = lock(newBSD)
{
errorBox "Cannot lock new Baseline Set Definition" errmess
return
}
//ADD MODULES
Item i
ModName_mod
for i in f do{
if (type(i) == "Formal")
{
mod = module(fullName i)
{
if (!null mod)
{
errmess = addModule(mod, newBSD)
if (!null errmess)
{
errorBox "Could not add module" name(mod)" : " errmess
}
}
}
}
}
errmess = save(newBSD)
if (!null errmess)
{
errorBox "Failed to save Definition" errmess
}
unlock(newBSD)
}
createBSD
-Louie |
Re: Emulate BaselineSet llandale - Wed Oct 24 16:30:48 EDT 2012
-Louie
I see...
void openModules() {
Item selItem
int selItemToken
Module selMod
for (selItemToken=0; selItemToken<noElems(selectedListView); selItemToken++) {
raise(selectModulesDB)
selItem = item(get(selectedListView, selItemToken))
if (null selItem) {
// If not found, then not found
set(selectedListView, selItemToken)
} else {
if (type(selItem)!="Formal") {
// If not a formal module, it's not applicable
set(selectedListView, selItemToken)
} else {
selMod = edit(rootName_(selItem), false, false, true)
if (null selMod) {
// If not found, then not found
set(selectedListView, selItemToken)
}
}
}
}
}
void createBSD(){
BaselineSetDefinition newBSD
BaselineSet newBS
Item i
Folder f = folder("/EMB550_04_Systems")
string errmess
Skip moduleSkip = create
bool major = false
int skipIndex = 0
int selItemToken
errmess = create(f, "Completeness BaselineSet", "oioioi", newBSD)
save(newBSD)
lock(newBSD)
for (selItemToken=0; selItemToken<noElems(selectedListView); selItemToken++) {
raise(selectModulesDB)
i = item(get(selectedListView, selItemToken))
if (null i) {
// If not found, then not found
set(selectedListView, selItemToken)
} else {
if (type(i) == "Formal"){
selMod = module(fullName i)
addModule(selMod, newBSD)
put(moduleSkip, skipIndex, selMod)
create(newBSD, major, "Test", "Hello", newBS)
unlock(newBSD)
string check = addBaselines(moduleSkip, newBS)
}
}
}
close(newBS)
save(newBSD)
delete(moduleSkip)
}
|
Re: Emulate BaselineSet
Okay...I'm trying piece by piece...
//Define Variables
void creatBSD(){
Folder f = current
BaselineSetDefinition newBSD = null
BaselineSet newBS
ModName_ mod
Module m = current
int skipIndex = 0
Skip moduleSkip = create
bool major = false
string modpath = fullName(m)
mod = module(modpath)
close(m)
//Create, save and lock baseline set definition
create(f, "BaselineSet Test", "descrição", newBSD)
save(newBSD)
lock(newBSD)
//Add module to BSD
addModule(mod, newBSD)
//Add module to skiplist
put(moduleSkip, skipIndex, mod)
//Create baseline set
create(newBSD, major, "Teste", "oioioi", newBS)
unlock(newBSD)
//Add baselines to baseline set
string check = addBaselines(moduleSkip, newBS)
if (!null check)
{
print "error"
}
//close variables
close(newBS)
delete(moduleSkip)
}
|
Re: Emulate BaselineSet Bruwbruw - Thu Oct 25 12:59:36 EDT 2012
Okay...I'm trying piece by piece...
//Define Variables
void creatBSD(){
Folder f = current
BaselineSetDefinition newBSD = null
BaselineSet newBS
ModName_ mod
Module m = current
int skipIndex = 0
Skip moduleSkip = create
bool major = false
string modpath = fullName(m)
mod = module(modpath)
close(m)
//Create, save and lock baseline set definition
create(f, "BaselineSet Test", "descrição", newBSD)
save(newBSD)
lock(newBSD)
//Add module to BSD
addModule(mod, newBSD)
//Add module to skiplist
put(moduleSkip, skipIndex, mod)
//Create baseline set
create(newBSD, major, "Teste", "oioioi", newBS)
unlock(newBSD)
//Add baselines to baseline set
string check = addBaselines(moduleSkip, newBS)
if (!null check)
{
print "error"
}
//close variables
close(newBS)
delete(moduleSkip)
}
You need to help us out here more.
In your previous post ... ... line 28 you are using the same Key (skipIndex) for all attempted "puts", which will result in only one value in the skip. Seems like you need one of these:
In this example ... Don't use "m = current"; send the Module handle into the Function. I've argued ad-nausium against using a statement like that since the "current" module changes as modules are opened, and it is difficult to guess when the "current" module will change. I'm guessing this is your "works first time but not 2nd time" problem; since the 1st time a module is actually opened which changes "current"; but the 2nd time that module is already open and issuing a "read" on it does NOT change the "current" module. Somewhere else you would have:
-Louie |
Re: Emulate BaselineSet llandale - Thu Oct 25 15:21:17 EDT 2012
In your previous post ... ... line 28 you are using the same Key (skipIndex) for all attempted "puts", which will result in only one value in the skip. Seems like you need one of these:
In this example ... Don't use "m = current"; send the Module handle into the Function. I've argued ad-nausium against using a statement like that since the "current" module changes as modules are opened, and it is difficult to guess when the "current" module will change. I'm guessing this is your "works first time but not 2nd time" problem; since the 1st time a module is actually opened which changes "current"; but the 2nd time that module is already open and issuing a "read" on it does NOT change the "current" module. Somewhere else you would have:
-Louie I got a little desesperated here, and I confuse myself. Thanks for the tip. I made some changes its doing what its supossed to, and thanks for the skip part, its was my next question! This baseline thing is more annoying than I thought. Thanks again! |